﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;

namespace LogManager.Config.Event
{
    [ConfigurationCollection(typeof(EventPropertyConfiguration), AddItemName = "property")]
    public class EventPropertyCollection : ConfigurationElementCollection
    {
        public new EventPropertyConfiguration this[string typeId]
        {
            get { return (EventPropertyConfiguration)BaseGet(typeId); }
        }

        public EventPropertyConfiguration this[int index]
        {
            get { return (EventPropertyConfiguration)BaseGet(index); }
        }

        protected override object GetElementKey(ConfigurationElement element)
        {
            return ((EventPropertyConfiguration)element).PropertyName;
        }

        protected override ConfigurationElement CreateNewElement()
        {
            return new EventPropertyConfiguration();
        }

        public void Add(EventPropertyConfiguration property)
        {
            BaseAdd(property);
        }

        public void Remove(EventPropertyConfiguration property)
        {
            BaseRemove(property);
        }
    }
}
